import { Component, EventEmitter, Input, Output } from '@angular/core';

@Component({
    selector: 'op-modal-dialog',
    templateUrl: './modal-dialog.component.html'
})
export class ModalDialogComponent {
    @Input() modalId: string;
    @Input() modalTitle: string;
    
    // Modal size. Accepts 3 size types. modal-lg, modal-md and modal-sm. The default is modal-md.
    // Empty string means modal-md.
    @Input() modalSize: string = '';

    @Input() hideCancelButton: boolean = false;
    @Output() confirm: EventEmitter<any> = new EventEmitter<any>();
    @Output() cancel: EventEmitter<any> = new EventEmitter<any>();

    constructor() { }

    confirmAction(): void {
        this.confirm.emit();
    }

    cancelAction(): void {
        this.cancel.emit();
    }
}